
finp$="ubuntustudio-brushes.png"
'finp$="ubuntustudio-lense.png"
'finp$="ubuntustudio-mixer.png"

setdisplay(320,240,32,1):paper(8^8-1):ink(0):pen(0):cls
loadimage(finp$,1):pasteicon(0,0,1)
fout$=finp$+"_.bin"

open fout$ for output as #1

for y=0 to 24
  for x=0 to 39
    u=point(x,y)
    b=u mod 256:u=int(u/256)
    g=u mod 256:u=int(u/256)
    r=u mod 256:u=int(u/256)

    r0=bitwiseand(r,128)/128
    r1=bitwiseand(r,64)/64
    g0=bitwiseand(g,128)/128
    g1=bitwiseand(g,64)/64
    b0=bitwiseand(b,128)/128
    b1=bitwiseand(b,64)/64

    bo=128+r1*1+g1*2+b1*4+r0*16+g0*32+b0*64
    writebyte(1,bo)

    next:next

close #1

'grab(1,0,0,320,240):saveimage("pic1b.bmp",1)
'waitkey

